<?php
// +----------------------------------------------------------------------
// | 海豚PHP框架 [ DolphinPHP ]
// +----------------------------------------------------------------------
// | 版权所有 2016~2017 河源市卓锐科技有限公司 [ http://www.zrthink.com ]
// +----------------------------------------------------------------------
// | 官方网站: http://dolphinphp.com
// +----------------------------------------------------------------------
// | 开源协议 ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------

namespace app\goods\validate;

use think\Validate;

/**
 * 表单验证器
 * @package app\admin\validate
 * @author 蔡伟明 <314013107@qq.com>
 */
class Form extends Validate
{
    //定义验证规则
    protected $rule = [
        'name|商品名称'   => 'require',
        'originalPrice'=>'require|number|min:0',
        'minPrice'=>['require','number','min'=>'0'],
        'specification_type_id'=>['require','number'],
        'stores'=>['require','number','min'=>'0'],
    ];
    protected $message = [
        'name.require'  =>  '商品名必须',
        'originalPrice.require' =>  '原价必须',
        'minPrice.require' =>  '现价必须',
        'specification_type_id.require' =>  '必须选择规格',
        'stores'=>'商品库存不能为空',
    ];
}